import unittest
import app
from scripts.test_login import LoginTest
from scripts.test_emp import EmpTest
from tools.HTMLTestRunner import HTMLTestRunner

# 封装测试套件
suite = unittest.TestSuite()
# 登录测试
suite.addTest(unittest.makeSuite(LoginTest))
# 员工测试
suite.addTest(LoginTest("test_setHeaders"))
suite.addTest(unittest.makeSuite(EmpTest))

# 文件地址
fileAddress = app.BASE_ADDRESS + "/report/report.html"

# 生成文件
with open(fileAddress, "wb")as file:
    runner = HTMLTestRunner(file, title="IHRM_System_TestReport")
    runner.run(suite)
